﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EpidemicSimulator.stopconditions
{
    public class NoInfectedNodesStopCondition: StopCondition
    {
        #region StopCondition Members

        public bool check(Simulation simulation)
        {
            var g = simulation.getSimulationResult();
            foreach (SocialNetworkNode node in g.Vertices)
            {
                if (node.state.stateNode.infected) return false;
            }
            return true;
        }

        #endregion
    }
}
